package ar.edu.unq.dodb.morphia.model;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Version;

public abstract class Entidad implements IEntidad {
	@Version()
	private Long version = null;
	@Id
	private String id = new ObjectId().toStringMongod();

	public Entidad() {

	}

	@Override
	public String getId() {
		return id;
	}

	@Override
	public Long getVersion() {
		return version;
	}

	// @PreLoad
	// public void preLoad(final DBObject obj) {
	// System.out.println(obj);
	// }

	@Override
	public void setId(final String id) {
		this.id = id;
	}

	@Override
	public void setVersion(final Long version) {
		this.version = version;
	}
}
